package com.jokins.admin.vue.hefeng.Service.impl;

import com.jokins.admin.vue.hefeng.Service.WeatherService;
import com.jokins.admin.vue.hefeng.actioncontext.GetToDayWeatherDoc;
import com.jokins.admin.vue.hefeng.vo.WeatherVo;
import com.jokins.common.actions.action.ActionContext;
import com.jokins.common.actions.util.ActionDispatcher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class WeatherServiceImpl implements WeatherService {


    /**
     * 获取当天天气获取天气
     * @param cityId
     * @return
     */
    @Override
    public WeatherVo getToDayWeather(String cityId) {
        GetToDayWeatherDoc doc = new GetToDayWeatherDoc(cityId);
        ActionDispatcher.execute(doc);
        return (WeatherVo) doc.getResultValue(ActionContext.RESULT_DOC_KEY);
    }
}
